﻿<phone:PhoneApplicationPage 
    x:Class="ChinaUnicom.Settings"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
	xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="728" d:DesignWidth="480"
    shell:SystemTray.IsVisible="False" 
    toolkit:TiltEffect.IsTiltEnabled="True">

    <!--Transitions-->
    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>

    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Border Grid.Row="0" Background="#c40b0b">
            <Image Source="Themes/Images/settings-logo.png" Height="110" HorizontalAlignment="Left"/>
        </Border>
        <controls:Pivot x:Name="mainContainer" Grid.Row="1" SelectionChanged="OnPivotSelectionChanged">
            <controls:PivotItem Header="关于">
                <StackPanel Margin="12 0">
                    <TextBlock LineHeight="38">
                        <Run Text="联通助手" FontWeight="Bold" Foreground="#c40b0b"/>
                        <Run Text=" (版本 1.0)"/>
                    </TextBlock>
                    <TextBlock Text="Copyright (c) 2012 Junhua" LineHeight="48"/>

                    <TextBlock LineHeight="30" TextWrapping="Wrap">
                        <Run Text="Windows Phone 联通助手，非官方版本，由于联通没有公开的WebService Api，该版本采用 wap.10010.com 暴露的接口开发。"/><LineBreak/>        
                        <Run Text="版本 1.0"/><LineBreak/>   
                        <Run Text="包含内容："/><LineBreak/>   
                        <Run Text="1、显示套餐余量"/><LineBreak/>   
                        <Run Text="2、显示当月话费"/><LineBreak/> 
                        <Run Text="3、显示我的信息"/><LineBreak/>                    
                        <Run Text="4、切换账号"/><LineBreak/>
                    </TextBlock>
                    <RichTextBox>
                        <Paragraph>
                            <Run Text="这是一个开源项目，喜欢的朋友可以到Codeplex网站"/>
                            <Hyperlink x:Name="download" NavigateUri="http://chinauincom.codeplex.com/" TargetName="_blank">下载</Hyperlink>
                            <Run Text="源码。"/>
                        </Paragraph>
                    </RichTextBox>
                </StackPanel>
            </controls:PivotItem>
            <controls:PivotItem Header="设置">
                <Grid>
                    <Grid x:Name="loginPanel" Visibility="Collapsed">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="20"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <toolkit:PhoneTextBox x:Name="mobile" Hint="手机号码" Height="74" Width="450" HorizontalAlignment="Left" InputScope="Number"/>
                        <PasswordBox x:Name="password" Grid.Row="1" Height="74" Width="450" HorizontalAlignment="Left" GotFocus="OnPasswordGotFocus" LostFocus="OnPasswordLostFocus"/>
                        <TextBlock x:Name="passwordHint" Text="密码" Grid.Row="1" Width="60" HorizontalAlignment="Left" Margin="18,0,0,0" Foreground="{StaticResource PhoneRadioCheckBoxCheckDisabledBrush}" FontSize="24"  VerticalAlignment="Center" Height="34"/>
                        <Grid Grid.Row="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <toolkit:PhoneTextBox Grid.Column="0" x:Name="code" Hint="验证码" Height="74" Width="160" HorizontalAlignment="Left" InputScope="Number"/>
                            <Image x:Name="imgCode" Height="54" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="1"/>
                        </Grid>
                        <Button Grid.Row="4" Content="登录" Background="{StaticResource PhoneAccentBrush}" BorderBrush="{StaticResource PhoneAccentBrush}" Click="OnLoginClick" />
                    </Grid>
                    <Grid x:Name="signedPanel">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="80"/>
                            <RowDefinition Height="80"/>
                            <RowDefinition Height="80"/>
                        </Grid.RowDefinitions>
                        <TextBlock Grid.Row="0" VerticalAlignment="Center" FontSize="32" Margin="10,0,0,0">
                            <Run Text="客户名称"/><Run Text=" : "/><Run x:Name="clientName" Text=""/>
                        </TextBlock>
                        <TextBlock Grid.Row="1" VerticalAlignment="Center" FontSize="32" Margin="10,0,0,0">
                            <Run Text="手机号码"/><Run Text=" : "/><Run x:Name="mobileNumber" Text=""/>
                        </TextBlock>
                        <HyperlinkButton  FontSize="32" HorizontalAlignment="Left" Grid.Row="2" Content="注销 / 切换账户" Click="OnLogoutClick" />
                    </Grid>
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>

        <Rectangle Visibility="Collapsed" x:Name="coverRect" Grid.Row="1" Fill="#f0000000"/>
        <TextBlock Visibility="Collapsed" x:Name="loginingText" Grid.Row="1" Text="正在登录..." VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="{StaticResource PhoneAccentBrush}"/>
    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="back" IconUri="/Themes/Images/back.png" Text="返回" Click="OnBackButtonClick"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
